<?php

use app\assets\ApiAsset;
use app\assets\LayerAsset;
use app\assets\TableAsset;
use app\models\KeyMap;
use app\models\UserCardRecharge;
use app\widgets\LinkPager;
use app\widgets\ManagerTableOp;
use yii\helpers\Html;
use yii\helpers\Url;
use dosamigos\datepicker\DatePicker;
/**
 * @var $this yii\web\View
 * @var $rechargeList app\models\UserCardRecharge[]
 * @var $pagination yii\data\Pagination
 */

ApiAsset::register($this);
LayerAsset::register($this);
TableAsset::register($this);

$this->title = '代理商付款列表';
$this->params['breadcrumbs'][] = '财务管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<?php echo Html::beginForm('?', 'get', ['class'=>'form-inline']);?>
<div class="form-group">
    <label for="search_agent" class="sr-only">代理商</label>
    <?php echo Html::textInput('search_agent', Yii::$app->request->get('search_agent'), ['id' => 'search_agent', 'class' => 'form-control', 'placeholder' => '代理商', 'style' => 'width: 120px;']);?>
    <label for="time">支付时间</label>
    <?php echo DatePicker::widget([ 
        'name' => 'search_time', 
        'options' => ['placeholder' => '时间'], 
        'attribute' => 'time',
        'template' => '{addon}{input}',
        'value' => $current_time,
        'clientOptions' => [ 
            'autoclose' => true, 
            'format' => 'yyyy-mm-dd',
            'todayHighlight' => true, 
        ] 
    ]); ?>
</div>

<div class="form-group">
    <button class="btn btn-primary btn-sm">搜索</button>
</div>
<?php echo Html::endForm();?>
<table class="table table-striped table-bordered table-hover">
    <thead>
    <tr>
        <th class="center">
            <label class="pos-rel">
                <input type="checkbox" class="ace" />
                <span class="lbl">编号</span>
            </label>
        </th>
        <th>代理商</th>
        <th>金额</th>
        <th>账单编号</th>
        <th>商户订单号</th>
        <th>微信付款单号</th>
        <th>状态</th>
        <th>支付时间</th>
    </tr>
    </thead>

    <tbody>
    <?php foreach ($paymentList as $pay) {?>
        <tr>
            <td class="center"><label class="pos-rel"><input type="checkbox" class="ace" value="<?php echo $pay->id;?>" /><span class="lbl"><?php echo $pay->id;?></span></label></td>
            <td><?php echo $pay->name;?></td>
            <td><?php echo $pay->amount;?></td>
            <td><?php echo Html::a($pay->bill_id, ['/admin/finance/multi-commission', 'search_id' => $pay->bill_id]);?></td>
            <td><?php echo $pay->partner_trade_no;?></td>
            <td><?php echo $pay->payment_no;?></td>
            <td><?php echo KeyMap::getValue('payment_status',$pay->payment_status)?></td>
            <td><?php echo $pay->payment_time;?></td>
            
        </tr>
    <?php }?>
    </tbody>
</table>
<?php echo LinkPager::widget(['pagination' => $pagination]);?>

